const axios = require('axios')
let _baseUrl = '/bitahub'

// 发送验证码
export function sendCode (data) {
  const url = _baseUrl + '/manage/commitEmail' + data
  return axios.post(url, {}, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  }).then((res) => {
    return Promise.resolve(res.data)
  })
}

// 查询昵称
export function getUserNickname (query) {
  const url = _baseUrl + '/manage/getUserInfo' + query
  return axios.get(url).then((res) => {
    return Promise.resolve(res.data)
  })
}

// 更改
export function changePassword (data) {
  const url = _baseUrl + '/manage/resetPassword' + data
  return axios.post(url, {}, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  }).then((res) => {
    return Promise.resolve(res.data)
  })
}
